3.128 \(\int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx\)

Optimal. Leaf size=75 \[ -\frac {2 a \log (\tan (c+d x))}{b^3 d}-\frac {2 a \log (a \cot (c+d x)+b)}{b^3 d}+\frac {\frac {a}{b^2}+\frac {1}{a}}{d (a \cot (c+d x)+b)}+\frac {\tan (c+d x)}{b^2 d} \]

[Out]

(1/a+a/b^2)/d/(b+a*cot(d*x+c))-2*a*ln(b+a*cot(d*x+c))/b^3/d-2*a*ln(tan(d*x+c))/b^3/d+tan(d*x+c)/b^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3088, 894} \[ \frac {\frac {a}{b^2}+\frac {1}{a}}{d (a \cot (c+d x)+b)}-\frac {2 a \log (\tan (c+d x))}{b^3 d}-\frac {2 a \log (a \cot (c+d x)+b)}{b^3 d}+\frac {\tan (c+d x)}{b^2 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2/(a*Cos[c + d*x] + b*Sin[c + d*x])^2,x]

[Out]

(a^(-1) + a/b^2)/(d*(b + a*Cot[c + d*x])) - (2*a*Log[b + a*Cot[c + d*x]])/(b^3*d) - (2*a*Log[Tan[c + d*x]])/(b
^3*d) + Tan[c + d*x]/(b^2*d)

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 3088

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> -Dist[d^(-1), Subst[Int[(x^m*(b + a*x)^n)/(1 + x^2)^((m + n + 2)/2), x], x, Cot[c + d*x]], x] /; FreeQ[
{a, b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[n, 0] && GtQ[m, 1])

Rubi steps

\begin {align*} \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {1+x^2}{x^2 (b+a x)^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {1}{b^2 x^2}-\frac {2 a}{b^3 x}+\frac {a^2+b^2}{b^2 (b+a x)^2}+\frac {2 a^2}{b^3 (b+a x)}\right ) \, dx,x,\cot (c+d x)\right )}{d}\\ &=\frac {\frac {1}{a}+\frac {a}{b^2}}{d (b+a \cot (c+d x))}-\frac {2 a \log (b+a \cot (c+d x))}{b^3 d}-\frac {2 a \log (\tan (c+d x))}{b^3 d}+\frac {\tan (c+d x)}{b^2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.27, size = 51, normalized size = 0.68 \[ \frac {-\frac {a^2+b^2}{a+b \tan (c+d x)}-2 a \log (a+b \tan (c+d x))+b \tan (c+d x)}{b^3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2/(a*Cos[c + d*x] + b*Sin[c + d*x])^2,x]

[Out]

(-2*a*Log[a + b*Tan[c + d*x]] + b*Tan[c + d*x] - (a^2 + b^2)/(a + b*Tan[c + d*x]))/(b^3*d)

________________________________________________________________________________________

fricas [B]  time = 0.48, size = 178, normalized size = 2.37 \[ -\frac {2 \, b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - b^{2} + {\left (a^{2} \cos \left (d x + c\right )^{2} + a b \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (a^{2} \cos \left (d x + c\right )^{2} + a b \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right )}{a b^{3} d \cos \left (d x + c\right )^{2} + b^{4} d \cos \left (d x + c\right ) \sin \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-(2*b^2*cos(d*x + c)^2 - 2*a*b*cos(d*x + c)*sin(d*x + c) - b^2 + (a^2*cos(d*x + c)^2 + a*b*cos(d*x + c)*sin(d*
x + c))*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2) - (a^2*cos(d*x + c)^2 + a*b*co
s(d*x + c)*sin(d*x + c))*log(cos(d*x + c)^2))/(a*b^3*d*cos(d*x + c)^2 + b^4*d*cos(d*x + c)*sin(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.25, size = 71, normalized size = 0.95 \[ -\frac {\frac {2 \, a \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{3}} - \frac {\tan \left (d x + c\right )}{b^{2}} - \frac {2 \, a b \tan \left (d x + c\right ) + a^{2} - b^{2}}{{\left (b \tan \left (d x + c\right ) + a\right )} b^{3}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-(2*a*log(abs(b*tan(d*x + c) + a))/b^3 - tan(d*x + c)/b^2 - (2*a*b*tan(d*x + c) + a^2 - b^2)/((b*tan(d*x + c)
+ a)*b^3))/d

________________________________________________________________________________________

maple [A]  time = 0.31, size = 78, normalized size = 1.04 \[ \frac {\tan \left (d x +c \right )}{b^{2} d}-\frac {2 a \ln \left (a +b \tan \left (d x +c \right )\right )}{d \,b^{3}}-\frac {a^{2}}{d \,b^{3} \left (a +b \tan \left (d x +c \right )\right )}-\frac {1}{d b \left (a +b \tan \left (d x +c \right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^2,x)

[Out]

tan(d*x+c)/b^2/d-2/d*a/b^3*ln(a+b*tan(d*x+c))-1/d/b^3/(a+b*tan(d*x+c))*a^2-1/d/b/(a+b*tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 60, normalized size = 0.80 \[ -\frac {\frac {a^{2} + b^{2}}{b^{4} \tan \left (d x + c\right ) + a b^{3}} + \frac {2 \, a \log \left (b \tan \left (d x + c\right ) + a\right )}{b^{3}} - \frac {\tan \left (d x + c\right )}{b^{2}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-((a^2 + b^2)/(b^4*tan(d*x + c) + a*b^3) + 2*a*log(b*tan(d*x + c) + a)/b^3 - tan(d*x + c)/b^2)/d

________________________________________________________________________________________

mupad [B]  time = 2.36, size = 382, normalized size = 5.09 \[ \frac {\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^2+b^2\right )}{a\,b^2}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2+b^2\right )}{a\,b^2}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {4\,a\,\mathrm {atanh}\left (\frac {64\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{64\,a^3-64\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {128\,a^5}{b^2}-\frac {128\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {128\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}-\frac {64\,a^3}{64\,a^3-64\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {128\,a^5}{b^2}-\frac {128\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {128\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {128\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^3\,b+\frac {128\,a^5}{b}+128\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {128\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b}-64\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{b^3\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^2*(a*cos(c + d*x) + b*sin(c + d*x))^2),x)

[Out]

((4*tan(c/2 + (d*x)/2)^2)/b - (2*tan(c/2 + (d*x)/2)^3*(2*a^2 + b^2))/(a*b^2) + (2*tan(c/2 + (d*x)/2)*(2*a^2 +
b^2))/(a*b^2))/(d*(a + 2*b*tan(c/2 + (d*x)/2) - 2*a*tan(c/2 + (d*x)/2)^2 + a*tan(c/2 + (d*x)/2)^4 - 2*b*tan(c/
2 + (d*x)/2)^3)) - (4*a*atanh((64*a^3*tan(c/2 + (d*x)/2)^2)/(64*a^3 - 64*a^3*tan(c/2 + (d*x)/2)^2 + (128*a^5)/
b^2 - (128*a^5*tan(c/2 + (d*x)/2)^2)/b^2 + (128*a^4*tan(c/2 + (d*x)/2))/b) - (64*a^3)/(64*a^3 - 64*a^3*tan(c/2
 + (d*x)/2)^2 + (128*a^5)/b^2 - (128*a^5*tan(c/2 + (d*x)/2)^2)/b^2 + (128*a^4*tan(c/2 + (d*x)/2))/b) + (128*a^
4*tan(c/2 + (d*x)/2))/(64*a^3*b + (128*a^5)/b + 128*a^4*tan(c/2 + (d*x)/2) - (128*a^5*tan(c/2 + (d*x)/2)^2)/b
- 64*a^3*b*tan(c/2 + (d*x)/2)^2)))/(b^3*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{2}{\left (c + d x \right )}}{\left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2/(a*cos(d*x+c)+b*sin(d*x+c))**2,x)

[Out]

Integral(sec(c + d*x)**2/(a*cos(c + d*x) + b*sin(c + d*x))**2, x)

________________________________________________________________________________________